#!/usr/bin/env python
import rospy
import roslib
from tcr100.msg import BatteryState

class led_control():

    def __init__(self):
        rospy.init_node("battery_test") 
        rospy.loginfo("battery test program")     
        self.pub=rospy.Publisher("/battery_state",BatteryState,queue_size=10)
        self.r = rospy.Rate(10)
    def spin(self):
    ############################################################# 
        ###### main loop  ######
        while not rospy.is_shutdown():
            battery=BatteryState()
            battery.name="Battery"
            battery.temperature=40.50
            battery.voltage=23.83
            battery.current=15.32
            battery.capacity_percentage=80.42
            battery.remaining_capacity=38.23
            battery.loop_counts=20
            battery.design_capacity=40.00
            self.pub.publish(battery)
            self.r.sleep()
if __name__ == '__main__':
    led_control=led_control()
    led_control.spin()
